//@author A0096466N
//
// **********
//
// Event class contains 2 parts,
// a command, and a task
//
// **********

#include "Event.h"

Event::Event(void) {

}

Event::~Event(void) {

}

string Event::getCommand() {
	return _command;
}

Task Event::getTask() {
	return _task;
}

void Event::changeCommand(string command) {
	_command = command;
}

void Event::changeTask(Task & task) {
	
	_task.changeStatus(task.getStatus());
	_task.changeDateInSeconds(task.getDateInSeconds());
	_task.changeTaskName(task.getTaskName());
	_task.changeDeadline(task.getDeadline());
	_task.changePriority(task.getPriority());
	_task.changeTime(task.getTime());
	
	_task.changeModifiedTaskName(task.getModifiedTaskName());
	_task.changeModifiedDeadline(task.getModifiedDeadline());
	_task.changeModifiedPriority(task.getModifiedPriority());
	_task.changeModifiedTime(task.getModifiedTime());
	_task.changeTaskLine(task.getTaskLine());
	_task.changeModifiedStatus(task.getModifiedStatus());
	_task.changeModifiedDateInSeconds(task.getModifiedDateInSeconds());

	// this problem occurs when date added is after 19/1/2038
	// task.getDateInSeconds() is correct,
	// however _task.getDateInSeconds() becomes negative.
	if(_task.getDateInSeconds() != task.getDateInSeconds()) {
		throw exception("deadline error");
	}
	if(_task.getModifiedDateInSeconds() != task.getModifiedDateInSeconds()) {
		throw exception("deadline error");
	}


	return;
}